{% extends 'airshow/base.html' %}

{% block title %}珠海航展数据管理系统 - 首页{% endblock %}

{% block content %}
<div class="jumbotron p-4 bg-light rounded-3 mb-4">
    <h1 class="display-4">欢迎使用珠海航展数据管理系统</h1>
    <p class="lead">这是一个用于管理珠海航展数据的Web应用，您可以查看和管理展区、参展商、展品以及活动日程等信息。</p>
</div>

<div class="row">
    <div class="col-md-3">
        <div class="card text-center">
            <div class="card-header">展区数量</div>
            <div class="card-body">
                <h2 class="card-title">{{ areas_count }}</h2>
                <p class="card-text">当前系统中的展区数量</p>
                <a href="{% url 'airshow:area_list_view' %}" class="btn btn-primary">查看展区</a>
            </div>
        </div>
    </div>
    
    <div class="col-md-3">
        <div class="card text-center">
            <div class="card-header">参展商数量</div>
            <div class="card-body">
                <h2 class="card-title">{{ exhibitors_count }}</h2>
                <p class="card-text">当前系统中的参展商数量</p>
                <a href="{% url 'airshow:exhibitor_list' %}" class="btn btn-primary">查看参展商</a>
            </div>
        </div>
    </div>
    
    <div class="col-md-3">
        <div class="card text-center">
            <div class="card-header">展品数量</div>
            <div class="card-body">
                <h2 class="card-title">{{ exhibits_count }}</h2>
                <p class="card-text">当前系统中的展品数量</p>
                <a href="{% url 'airshow:exhibit_info_list' %}" class="btn btn-primary">查看展品</a>
            </div>
        </div>
    </div>
    
    <div class="col-md-3">
        <div class="card text-center">
            <div class="card-header">活动数量</div>
            <div class="card-body">
                <h2 class="card-title">{{ events_count }}</h2>
                <p class="card-text">当前系统中的活动数量</p>
                <a href="{% url 'airshow:schedule_list' %}" class="btn btn-primary">查看活动</a>
            </div>
        </div>
    </div>
</div>

<div class="row mt-4">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">
                <h5>即将到来的活动</h5>
            </div>
            <div class="card-body">
                {% if upcoming_events %}
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                                <tr>
                                    <th>活动名称</th>
                                    <th>时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                {% for event in upcoming_events %}
                                <tr>
                                    <td>{{ event.title }}</td>
                                    <td>{{ event.event_time|date:"Y-m-d H:i" }}</td>
                                    <td>
                                        <a href="{% url 'airshow:schedule_detail' event.event_id %}" class="btn btn-sm btn-info">查看详情</a>
                                    </td>
                                </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    </div>
                {% else %}
                    <p class="text-center">暂无即将到来的活动</p>
                {% endif %}
            </div>
        </div>
    </div>
</div>
{% endblock %} 